using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using AutoAttack.WinAPI;
using System.Runtime.InteropServices;
namespace AutoAttack
{
    public partial class Form1 : Form
    {
        string wCaption = "v10.06F Title";
        string wClass = "v10.06F Class";
        string wChildClass = "";
        IntPtr hWnd;
        IntPtr hChildWnd;
     

        string attack = "484518010565197207917675107801957610017128164229119214129808219495228173932419129";
        public Form1()
        {
            InitializeComponent();
            hWnd = WindowUtility.FindWindow(wClass, wCaption);
            if (!hWnd.Equals(IntPtr.Zero) && wChildClass!="")
            {
                hChildWnd = WindowUtility.FindWindowEx(hWnd, hChildWnd, wChildClass, "");
                hWnd = hChildWnd;
            }
           
            textBox1.Text = hWnd.ToInt32().ToString();
        }

         
        private void Form1_Load(object sender, EventArgs e)
        {
           // this.Focus();

        }

        private void button1_Click(object sender, EventArgs e)
        {
  
            int x = 0, y = 0;
           // CaptureScreen.GetCursorPosition(ref x, ref y);
           // textBox1.AppendText(String.Format("\r\nMouse x: {0} Mouse y: {1}",x,y));
           // Image img = CaptureScreen.CaptureCursor(ref x, ref y);
           // textBox1.AppendText(wu.ImageSign(img));
           ////wu.SendLeftButtonDown(100, 100);
           //// wu.SendMouseMove(200, 100);
           //// wu.SendLeftButtonUp(200, 100);

            WindowUtility wu = new WindowUtility(hWnd.ToInt32());
            wu.SetFocus();
            //wu.SendKeyDown(WindowUtility.VK_RETURN);
            //wu.SendKeyUp(WindowUtility.VK_RETURN);
            //wu.SendString(" Hello World");
            //wu.SendKeyDown(WindowUtility.VK_RETURN);
            //wu.SendKeyUp(WindowUtility.VK_RETURN);
         
            textBox1.AppendText("\r\nDone\r\n");
        }
        
        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
        }



    }
}